//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS CloudWatchEvents service.
///
/// Amazon EventBridge helps you to respond to state changes in your Amazon Web Services resources. When your resources change state, they automatically send events to an event stream. You can create rules that match selected events in the stream and route them to targets to take action. You can also use rules to take action on a predetermined schedule. For example, you can configure rules to:   Automatically invoke an Lambda function to update DNS entries when an event notifies you that Amazon EC2 instance enters the running state.   Direct specific API records from CloudTrail to an Amazon Kinesis data stream for detailed analysis of potential security or availability risks.   Periodically invoke a built-in target to create a snapshot of an Amazon EBS volume.   For more information about the features of Amazon EventBridge, see the Amazon EventBridge User Guide.
public struct CloudWatchEvents: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the CloudWatchEvents client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            amzTarget: "AWSEvents",
            serviceName: "CloudWatchEvents",
            serviceIdentifier: "events",
            serviceProtocol: .json(version: "1.1"),
            apiVersion: "2015-10-07",
            endpoint: endpoint,
            variantEndpoints: Self.variantEndpoints,
            errorType: CloudWatchEventsErrorType.self,
            xmlNamespace: "http://events.amazonaws.com/doc/2015-10-07",
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }




    /// FIPS and dualstack endpoints
    static var variantEndpoints: [EndpointVariantType: AWSServiceConfig.EndpointVariant] {[
        [.dualstack]: .init(endpoints: [
            "af-south-1": "events.af-south-1.api.aws",
            "ap-east-1": "events.ap-east-1.api.aws",
            "ap-northeast-1": "events.ap-northeast-1.api.aws",
            "ap-northeast-2": "events.ap-northeast-2.api.aws",
            "ap-northeast-3": "events.ap-northeast-3.api.aws",
            "ap-south-1": "events.ap-south-1.api.aws",
            "ap-south-2": "events.ap-south-2.api.aws",
            "ap-southeast-1": "events.ap-southeast-1.api.aws",
            "ap-southeast-2": "events.ap-southeast-2.api.aws",
            "ap-southeast-3": "events.ap-southeast-3.api.aws",
            "ap-southeast-4": "events.ap-southeast-4.api.aws",
            "ap-southeast-5": "events.ap-southeast-5.api.aws",
            "ap-southeast-7": "events.ap-southeast-7.api.aws",
            "ca-central-1": "events.ca-central-1.api.aws",
            "ca-west-1": "events.ca-west-1.api.aws",
            "cn-north-1": "events.cn-north-1.api.amazonwebservices.com.cn",
            "cn-northwest-1": "events.cn-northwest-1.api.amazonwebservices.com.cn",
            "eu-central-1": "events.eu-central-1.api.aws",
            "eu-central-2": "events.eu-central-2.api.aws",
            "eu-north-1": "events.eu-north-1.api.aws",
            "eu-south-1": "events.eu-south-1.api.aws",
            "eu-south-2": "events.eu-south-2.api.aws",
            "eu-west-1": "events.eu-west-1.api.aws",
            "eu-west-2": "events.eu-west-2.api.aws",
            "eu-west-3": "events.eu-west-3.api.aws",
            "il-central-1": "events.il-central-1.api.aws",
            "me-central-1": "events.me-central-1.api.aws",
            "me-south-1": "events.me-south-1.api.aws",
            "mx-central-1": "events.mx-central-1.api.aws",
            "sa-east-1": "events.sa-east-1.api.aws",
            "us-east-1": "events.us-east-1.api.aws",
            "us-east-2": "events.us-east-2.api.aws",
            "us-west-1": "events.us-west-1.api.aws",
            "us-west-2": "events.us-west-2.api.aws"
        ]),
        [.dualstack, .fips]: .init(endpoints: [
            "us-east-1": "events-fips.us-east-1.api.aws",
            "us-east-2": "events-fips.us-east-2.api.aws",
            "us-west-1": "events-fips.us-west-1.api.aws",
            "us-west-2": "events-fips.us-west-2.api.aws"
        ]),
        [.fips]: .init(endpoints: [
            "us-east-1": "events-fips.us-east-1.amazonaws.com",
            "us-east-2": "events-fips.us-east-2.amazonaws.com",
            "us-gov-east-1": "events.us-gov-east-1.amazonaws.com",
            "us-gov-west-1": "events.us-gov-west-1.amazonaws.com",
            "us-west-1": "events-fips.us-west-1.amazonaws.com",
            "us-west-2": "events-fips.us-west-2.amazonaws.com"
        ])
    ]}

    // MARK: API Calls

    /// Activates a partner event source that has been deactivated. Once activated, your matching event bus will start receiving events from the event source.
    @Sendable
    @inlinable
    public func activateEventSource(_ input: ActivateEventSourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "ActivateEventSource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Activates a partner event source that has been deactivated. Once activated, your matching event bus will start receiving events from the event source.
    ///
    /// Parameters:
    ///   - name: The name of the partner event source to activate.
    ///   - logger: Logger use during operation
    @inlinable
    public func activateEventSource(
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = ActivateEventSourceRequest(
            name: name
        )
        return try await self.activateEventSource(input, logger: logger)
    }

    /// Cancels the specified replay.
    @Sendable
    @inlinable
    public func cancelReplay(_ input: CancelReplayRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CancelReplayResponse {
        try await self.client.execute(
            operation: "CancelReplay", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Cancels the specified replay.
    ///
    /// Parameters:
    ///   - replayName: The name of the replay to cancel.
    ///   - logger: Logger use during operation
    @inlinable
    public func cancelReplay(
        replayName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CancelReplayResponse {
        let input = CancelReplayRequest(
            replayName: replayName
        )
        return try await self.cancelReplay(input, logger: logger)
    }

    /// Creates an API destination, which is an HTTP invocation endpoint configured as a target for events.
    @Sendable
    @inlinable
    public func createApiDestination(_ input: CreateApiDestinationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateApiDestinationResponse {
        try await self.client.execute(
            operation: "CreateApiDestination", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates an API destination, which is an HTTP invocation endpoint configured as a target for events.
    ///
    /// Parameters:
    ///   - connectionArn: The ARN of the connection to use for the API destination. The destination endpoint must support the authorization type specified for the connection.
    ///   - description: A description for the API destination to create.
    ///   - httpMethod: The method to use for the request to the HTTP invocation endpoint.
    ///   - invocationEndpoint: The URL to the HTTP invocation endpoint for the API destination.
    ///   - invocationRateLimitPerSecond: The maximum number of requests per second to send to the HTTP invocation endpoint.
    ///   - name: The name for the API destination to create.
    ///   - logger: Logger use during operation
    @inlinable
    public func createApiDestination(
        connectionArn: String,
        description: String? = nil,
        httpMethod: ApiDestinationHttpMethod,
        invocationEndpoint: String,
        invocationRateLimitPerSecond: Int? = nil,
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateApiDestinationResponse {
        let input = CreateApiDestinationRequest(
            connectionArn: connectionArn, 
            description: description, 
            httpMethod: httpMethod, 
            invocationEndpoint: invocationEndpoint, 
            invocationRateLimitPerSecond: invocationRateLimitPerSecond, 
            name: name
        )
        return try await self.createApiDestination(input, logger: logger)
    }

    /// Creates an archive of events with the specified settings. When you create an archive, incoming events might not immediately start being sent to the archive. Allow a short period of time for changes to take effect. If you do not specify a pattern to filter events sent to the archive, all events are sent to the archive except replayed events. Replayed events are not sent to an archive.
    @Sendable
    @inlinable
    public func createArchive(_ input: CreateArchiveRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateArchiveResponse {
        try await self.client.execute(
            operation: "CreateArchive", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates an archive of events with the specified settings. When you create an archive, incoming events might not immediately start being sent to the archive. Allow a short period of time for changes to take effect. If you do not specify a pattern to filter events sent to the archive, all events are sent to the archive except replayed events. Replayed events are not sent to an archive.
    ///
    /// Parameters:
    ///   - archiveName: The name for the archive to create.
    ///   - description: A description for the archive.
    ///   - eventPattern: An event pattern to use to filter events sent to the archive.
    ///   - eventSourceArn: The ARN of the event bus that sends events to the archive.
    ///   - retentionDays: The number of days to retain events for. Default value is 0. If set to 0, events are retained indefinitely
    ///   - logger: Logger use during operation
    @inlinable
    public func createArchive(
        archiveName: String,
        description: String? = nil,
        eventPattern: String? = nil,
        eventSourceArn: String,
        retentionDays: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateArchiveResponse {
        let input = CreateArchiveRequest(
            archiveName: archiveName, 
            description: description, 
            eventPattern: eventPattern, 
            eventSourceArn: eventSourceArn, 
            retentionDays: retentionDays
        )
        return try await self.createArchive(input, logger: logger)
    }

    /// Creates a connection. A connection defines the authorization type and credentials to use for authorization with an API destination HTTP endpoint.
    @Sendable
    @inlinable
    public func createConnection(_ input: CreateConnectionRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateConnectionResponse {
        try await self.client.execute(
            operation: "CreateConnection", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a connection. A connection defines the authorization type and credentials to use for authorization with an API destination HTTP endpoint.
    ///
    /// Parameters:
    ///   - authorizationType: The type of authorization to use for the connection.
    ///   - authParameters: A CreateConnectionAuthRequestParameters object that contains the authorization parameters to use to authorize with the endpoint.
    ///   - description: A description for the connection to create.
    ///   - name: The name for the connection to create.
    ///   - logger: Logger use during operation
    @inlinable
    public func createConnection(
        authorizationType: ConnectionAuthorizationType,
        authParameters: CreateConnectionAuthRequestParameters,
        description: String? = nil,
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateConnectionResponse {
        let input = CreateConnectionRequest(
            authorizationType: authorizationType, 
            authParameters: authParameters, 
            description: description, 
            name: name
        )
        return try await self.createConnection(input, logger: logger)
    }

    /// Creates a new event bus within your account. This can be a custom event bus which you can use to receive events from your custom applications and services, or it can be a partner event bus which can be matched to a partner event source.
    @Sendable
    @inlinable
    public func createEventBus(_ input: CreateEventBusRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateEventBusResponse {
        try await self.client.execute(
            operation: "CreateEventBus", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a new event bus within your account. This can be a custom event bus which you can use to receive events from your custom applications and services, or it can be a partner event bus which can be matched to a partner event source.
    ///
    /// Parameters:
    ///   - eventSourceName: If you are creating a partner event bus, this specifies the partner event source that the new event bus will be matched with.
    ///   - name: The name of the new event bus.  Event bus names cannot contain the / character. You can't use the name default for a custom event bus, as this name is already used for your account's default event bus. If this is a partner event bus, the name must exactly match the name of the partner event source that this event bus is matched to.
    ///   - tags: Tags to associate with the event bus.
    ///   - logger: Logger use during operation
    @inlinable
    public func createEventBus(
        eventSourceName: String? = nil,
        name: String,
        tags: [Tag]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateEventBusResponse {
        let input = CreateEventBusRequest(
            eventSourceName: eventSourceName, 
            name: name, 
            tags: tags
        )
        return try await self.createEventBus(input, logger: logger)
    }

    /// Called by an SaaS partner to create a partner event source. This operation is not used by Amazon Web Services customers. Each partner event source can be used by one Amazon Web Services account to create a matching partner event bus in that Amazon Web Services account. A SaaS partner must create one partner event source for each Amazon Web Services account that wants to receive those event types.  A partner event source creates events based on resources within the SaaS partner's service or application. An Amazon Web Services account that creates a partner event bus that matches the partner event source can use that event bus to receive events from the partner, and then process them using Amazon Web Services Events rules and targets. Partner event source names follow this format:   partner_name/event_namespace/event_name    partner_name is determined during partner registration and identifies the partner to Amazon Web Services customers. event_namespace is determined by the partner and is a way for the partner to categorize their events. event_name is determined by the partner, and should uniquely identify an event-generating resource within the partner system. The combination of event_namespace and event_name should help Amazon Web Services customers decide whether to create an event bus to receive these events.
    @Sendable
    @inlinable
    public func createPartnerEventSource(_ input: CreatePartnerEventSourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreatePartnerEventSourceResponse {
        try await self.client.execute(
            operation: "CreatePartnerEventSource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Called by an SaaS partner to create a partner event source. This operation is not used by Amazon Web Services customers. Each partner event source can be used by one Amazon Web Services account to create a matching partner event bus in that Amazon Web Services account. A SaaS partner must create one partner event source for each Amazon Web Services account that wants to receive those event types.  A partner event source creates events based on resources within the SaaS partner's service or application. An Amazon Web Services account that creates a partner event bus that matches the partner event source can use that event bus to receive events from the partner, and then process them using Amazon Web Services Events rules and targets. Partner event source names follow this format:   partner_name/event_namespace/event_name    partner_name is determined during partner registration and identifies the partner to Amazon Web Services customers. event_namespace is determined by the partner and is a way for the partner to categorize their events. event_name is determined by the partner, and should uniquely identify an event-generating resource within the partner system. The combination of event_namespace and event_name should help Amazon Web Services customers decide whether to create an event bus to receive these events.
    ///
    /// Parameters:
    ///   - account: The Amazon Web Services account ID that is permitted to create a matching partner event bus for this partner event source.
    ///   - name: The name of the partner event source. This name must be unique and must be in the format  partner_name/event_namespace/event_name . The Amazon Web Services account that wants to use this partner event source must create a partner event bus with a name that matches the name of the partner event source.
    ///   - logger: Logger use during operation
    @inlinable
    public func createPartnerEventSource(
        account: String,
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreatePartnerEventSourceResponse {
        let input = CreatePartnerEventSourceRequest(
            account: account, 
            name: name
        )
        return try await self.createPartnerEventSource(input, logger: logger)
    }

    /// You can use this operation to temporarily stop receiving events from the specified partner event source. The matching event bus is not deleted.  When you deactivate a partner event source, the source goes into PENDING state. If it remains in PENDING state for more than two weeks, it is deleted. To activate a deactivated partner event source, use ActivateEventSource.
    @Sendable
    @inlinable
    public func deactivateEventSource(_ input: DeactivateEventSourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeactivateEventSource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// You can use this operation to temporarily stop receiving events from the specified partner event source. The matching event bus is not deleted.  When you deactivate a partner event source, the source goes into PENDING state. If it remains in PENDING state for more than two weeks, it is deleted. To activate a deactivated partner event source, use ActivateEventSource.
    ///
    /// Parameters:
    ///   - name: The name of the partner event source to deactivate.
    ///   - logger: Logger use during operation
    @inlinable
    public func deactivateEventSource(
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeactivateEventSourceRequest(
            name: name
        )
        return try await self.deactivateEventSource(input, logger: logger)
    }

    /// Removes all authorization parameters from the connection. This lets you remove the secret from the connection so you can reuse it without having to create a new connection.
    @Sendable
    @inlinable
    public func deauthorizeConnection(_ input: DeauthorizeConnectionRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeauthorizeConnectionResponse {
        try await self.client.execute(
            operation: "DeauthorizeConnection", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes all authorization parameters from the connection. This lets you remove the secret from the connection so you can reuse it without having to create a new connection.
    ///
    /// Parameters:
    ///   - name: The name of the connection to remove authorization from.
    ///   - logger: Logger use during operation
    @inlinable
    public func deauthorizeConnection(
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeauthorizeConnectionResponse {
        let input = DeauthorizeConnectionRequest(
            name: name
        )
        return try await self.deauthorizeConnection(input, logger: logger)
    }

    /// Deletes the specified API destination.
    @Sendable
    @inlinable
    public func deleteApiDestination(_ input: DeleteApiDestinationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteApiDestinationResponse {
        try await self.client.execute(
            operation: "DeleteApiDestination", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes the specified API destination.
    ///
    /// Parameters:
    ///   - name: The name of the destination to delete.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteApiDestination(
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteApiDestinationResponse {
        let input = DeleteApiDestinationRequest(
            name: name
        )
        return try await self.deleteApiDestination(input, logger: logger)
    }

    /// Deletes the specified archive.
    @Sendable
    @inlinable
    public func deleteArchive(_ input: DeleteArchiveRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteArchiveResponse {
        try await self.client.execute(
            operation: "DeleteArchive", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes the specified archive.
    ///
    /// Parameters:
    ///   - archiveName: The name of the archive to delete.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteArchive(
        archiveName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteArchiveResponse {
        let input = DeleteArchiveRequest(
            archiveName: archiveName
        )
        return try await self.deleteArchive(input, logger: logger)
    }

    /// Deletes a connection.
    @Sendable
    @inlinable
    public func deleteConnection(_ input: DeleteConnectionRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteConnectionResponse {
        try await self.client.execute(
            operation: "DeleteConnection", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a connection.
    ///
    /// Parameters:
    ///   - name: The name of the connection to delete.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteConnection(
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteConnectionResponse {
        let input = DeleteConnectionRequest(
            name: name
        )
        return try await self.deleteConnection(input, logger: logger)
    }

    /// Deletes the specified custom event bus or partner event bus. All rules associated with this event bus need to be deleted. You can't delete your account's default event bus.
    @Sendable
    @inlinable
    public func deleteEventBus(_ input: DeleteEventBusRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeleteEventBus", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes the specified custom event bus or partner event bus. All rules associated with this event bus need to be deleted. You can't delete your account's default event bus.
    ///
    /// Parameters:
    ///   - name: The name of the event bus to delete.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteEventBus(
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeleteEventBusRequest(
            name: name
        )
        return try await self.deleteEventBus(input, logger: logger)
    }

    /// This operation is used by SaaS partners to delete a partner event source. This operation is not used by Amazon Web Services customers. When you delete an event source, the status of the corresponding partner event bus in the Amazon Web Services customer account becomes DELETED.
    @Sendable
    @inlinable
    public func deletePartnerEventSource(_ input: DeletePartnerEventSourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeletePartnerEventSource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This operation is used by SaaS partners to delete a partner event source. This operation is not used by Amazon Web Services customers. When you delete an event source, the status of the corresponding partner event bus in the Amazon Web Services customer account becomes DELETED.
    ///
    /// Parameters:
    ///   - account: The Amazon Web Services account ID of the Amazon Web Services customer that the event source was created for.
    ///   - name: The name of the event source to delete.
    ///   - logger: Logger use during operation
    @inlinable
    public func deletePartnerEventSource(
        account: String,
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeletePartnerEventSourceRequest(
            account: account, 
            name: name
        )
        return try await self.deletePartnerEventSource(input, logger: logger)
    }

    /// Deletes the specified rule. Before you can delete the rule, you must remove all targets, using RemoveTargets. When you delete a rule, incoming events might continue to match to the deleted rule. Allow a short period of time for changes to take effect. If you call delete rule multiple times for the same rule, all calls will succeed. When you call delete rule for a non-existent custom eventbus, ResourceNotFoundException is returned. Managed rules are rules created and managed by another Amazon Web Services service on your behalf. These rules are created by those other Amazon Web Services services to support functionality in those services. You can delete these rules using the Force option, but you should do so only if you are sure the other service is not still using that rule.
    @Sendable
    @inlinable
    public func deleteRule(_ input: DeleteRuleRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeleteRule", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes the specified rule. Before you can delete the rule, you must remove all targets, using RemoveTargets. When you delete a rule, incoming events might continue to match to the deleted rule. Allow a short period of time for changes to take effect. If you call delete rule multiple times for the same rule, all calls will succeed. When you call delete rule for a non-existent custom eventbus, ResourceNotFoundException is returned. Managed rules are rules created and managed by another Amazon Web Services service on your behalf. These rules are created by those other Amazon Web Services services to support functionality in those services. You can delete these rules using the Force option, but you should do so only if you are sure the other service is not still using that rule.
    ///
    /// Parameters:
    ///   - eventBusName: The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.
    ///   - force: If this is a managed rule, created by an Amazon Web Services service on your behalf, you must specify Force as True to delete the rule. This parameter is ignored for rules that are not managed rules. You can check whether a rule is a managed rule by using DescribeRule or ListRules and checking the ManagedBy field of the response.
    ///   - name: The name of the rule.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteRule(
        eventBusName: String? = nil,
        force: Bool? = nil,
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeleteRuleRequest(
            eventBusName: eventBusName, 
            force: force, 
            name: name
        )
        return try await self.deleteRule(input, logger: logger)
    }

    /// Retrieves details about an API destination.
    @Sendable
    @inlinable
    public func describeApiDestination(_ input: DescribeApiDestinationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeApiDestinationResponse {
        try await self.client.execute(
            operation: "DescribeApiDestination", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves details about an API destination.
    ///
    /// Parameters:
    ///   - name: The name of the API destination to retrieve.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeApiDestination(
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeApiDestinationResponse {
        let input = DescribeApiDestinationRequest(
            name: name
        )
        return try await self.describeApiDestination(input, logger: logger)
    }

    /// Retrieves details about an archive.
    @Sendable
    @inlinable
    public func describeArchive(_ input: DescribeArchiveRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeArchiveResponse {
        try await self.client.execute(
            operation: "DescribeArchive", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves details about an archive.
    ///
    /// Parameters:
    ///   - archiveName: The name of the archive to retrieve.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeArchive(
        archiveName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeArchiveResponse {
        let input = DescribeArchiveRequest(
            archiveName: archiveName
        )
        return try await self.describeArchive(input, logger: logger)
    }

    /// Retrieves details about a connection.
    @Sendable
    @inlinable
    public func describeConnection(_ input: DescribeConnectionRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeConnectionResponse {
        try await self.client.execute(
            operation: "DescribeConnection", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves details about a connection.
    ///
    /// Parameters:
    ///   - name: The name of the connection to retrieve.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeConnection(
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeConnectionResponse {
        let input = DescribeConnectionRequest(
            name: name
        )
        return try await self.describeConnection(input, logger: logger)
    }

    /// Displays details about an event bus in your account. This can include the external Amazon Web Services accounts that are permitted to write events to your default event bus, and the associated policy. For custom event buses and partner event buses, it displays the name, ARN, policy, state, and creation time. To enable your account to receive events from other accounts on its default event bus, use PutPermission. For more information about partner event buses, see CreateEventBus.
    @Sendable
    @inlinable
    public func describeEventBus(_ input: DescribeEventBusRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeEventBusResponse {
        try await self.client.execute(
            operation: "DescribeEventBus", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Displays details about an event bus in your account. This can include the external Amazon Web Services accounts that are permitted to write events to your default event bus, and the associated policy. For custom event buses and partner event buses, it displays the name, ARN, policy, state, and creation time. To enable your account to receive events from other accounts on its default event bus, use PutPermission. For more information about partner event buses, see CreateEventBus.
    ///
    /// Parameters:
    ///   - name: The name or ARN of the event bus to show details for. If you omit this, the default event bus is displayed.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeEventBus(
        name: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeEventBusResponse {
        let input = DescribeEventBusRequest(
            name: name
        )
        return try await self.describeEventBus(input, logger: logger)
    }

    /// This operation lists details about a partner event source that is shared with your account.
    @Sendable
    @inlinable
    public func describeEventSource(_ input: DescribeEventSourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeEventSourceResponse {
        try await self.client.execute(
            operation: "DescribeEventSource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This operation lists details about a partner event source that is shared with your account.
    ///
    /// Parameters:
    ///   - name: The name of the partner event source to display the details of.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeEventSource(
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeEventSourceResponse {
        let input = DescribeEventSourceRequest(
            name: name
        )
        return try await self.describeEventSource(input, logger: logger)
    }

    /// An SaaS partner can use this operation to list details about a partner event source that they have created. Amazon Web Services customers do not use this operation. Instead, Amazon Web Services customers can use DescribeEventSource to see details about a partner event source that is shared with them.
    @Sendable
    @inlinable
    public func describePartnerEventSource(_ input: DescribePartnerEventSourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribePartnerEventSourceResponse {
        try await self.client.execute(
            operation: "DescribePartnerEventSource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// An SaaS partner can use this operation to list details about a partner event source that they have created. Amazon Web Services customers do not use this operation. Instead, Amazon Web Services customers can use DescribeEventSource to see details about a partner event source that is shared with them.
    ///
    /// Parameters:
    ///   - name: The name of the event source to display.
    ///   - logger: Logger use during operation
    @inlinable
    public func describePartnerEventSource(
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribePartnerEventSourceResponse {
        let input = DescribePartnerEventSourceRequest(
            name: name
        )
        return try await self.describePartnerEventSource(input, logger: logger)
    }

    /// Retrieves details about a replay. Use DescribeReplay to determine the progress of a running replay. A replay processes events to replay based on the time in the event, and replays them using 1 minute intervals. If you use StartReplay and specify an EventStartTime and an EventEndTime that covers a 20 minute time range, the events are replayed from the first minute of that 20 minute range first. Then the events from the second minute are replayed. You can use DescribeReplay to determine the progress of a replay. The value returned for EventLastReplayedTime indicates the time within the specified time range associated with the last event replayed.
    @Sendable
    @inlinable
    public func describeReplay(_ input: DescribeReplayRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeReplayResponse {
        try await self.client.execute(
            operation: "DescribeReplay", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves details about a replay. Use DescribeReplay to determine the progress of a running replay. A replay processes events to replay based on the time in the event, and replays them using 1 minute intervals. If you use StartReplay and specify an EventStartTime and an EventEndTime that covers a 20 minute time range, the events are replayed from the first minute of that 20 minute range first. Then the events from the second minute are replayed. You can use DescribeReplay to determine the progress of a replay. The value returned for EventLastReplayedTime indicates the time within the specified time range associated with the last event replayed.
    ///
    /// Parameters:
    ///   - replayName: The name of the replay to retrieve.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeReplay(
        replayName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeReplayResponse {
        let input = DescribeReplayRequest(
            replayName: replayName
        )
        return try await self.describeReplay(input, logger: logger)
    }

    /// Describes the specified rule. DescribeRule does not list the targets of a rule. To see the targets associated with a rule, use ListTargetsByRule.
    @Sendable
    @inlinable
    public func describeRule(_ input: DescribeRuleRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeRuleResponse {
        try await self.client.execute(
            operation: "DescribeRule", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Describes the specified rule. DescribeRule does not list the targets of a rule. To see the targets associated with a rule, use ListTargetsByRule.
    ///
    /// Parameters:
    ///   - eventBusName: The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.
    ///   - name: The name of the rule.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeRule(
        eventBusName: String? = nil,
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeRuleResponse {
        let input = DescribeRuleRequest(
            eventBusName: eventBusName, 
            name: name
        )
        return try await self.describeRule(input, logger: logger)
    }

    /// Disables the specified rule. A disabled rule won't match any events, and won't self-trigger if it has a schedule expression. When you disable a rule, incoming events might continue to match to the disabled rule. Allow a short period of time for changes to take effect.
    @Sendable
    @inlinable
    public func disableRule(_ input: DisableRuleRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DisableRule", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Disables the specified rule. A disabled rule won't match any events, and won't self-trigger if it has a schedule expression. When you disable a rule, incoming events might continue to match to the disabled rule. Allow a short period of time for changes to take effect.
    ///
    /// Parameters:
    ///   - eventBusName: The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.
    ///   - name: The name of the rule.
    ///   - logger: Logger use during operation
    @inlinable
    public func disableRule(
        eventBusName: String? = nil,
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DisableRuleRequest(
            eventBusName: eventBusName, 
            name: name
        )
        return try await self.disableRule(input, logger: logger)
    }

    /// Enables the specified rule. If the rule does not exist, the operation fails. When you enable a rule, incoming events might not immediately start matching to a newly enabled rule. Allow a short period of time for changes to take effect.
    @Sendable
    @inlinable
    public func enableRule(_ input: EnableRuleRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "EnableRule", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Enables the specified rule. If the rule does not exist, the operation fails. When you enable a rule, incoming events might not immediately start matching to a newly enabled rule. Allow a short period of time for changes to take effect.
    ///
    /// Parameters:
    ///   - eventBusName: The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.
    ///   - name: The name of the rule.
    ///   - logger: Logger use during operation
    @inlinable
    public func enableRule(
        eventBusName: String? = nil,
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = EnableRuleRequest(
            eventBusName: eventBusName, 
            name: name
        )
        return try await self.enableRule(input, logger: logger)
    }

    /// Retrieves a list of API destination in the account in the current Region.
    @Sendable
    @inlinable
    public func listApiDestinations(_ input: ListApiDestinationsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListApiDestinationsResponse {
        try await self.client.execute(
            operation: "ListApiDestinations", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves a list of API destination in the account in the current Region.
    ///
    /// Parameters:
    ///   - connectionArn: The ARN of the connection specified for the API destination.
    ///   - limit: The maximum number of API destinations to include in the response.
    ///   - namePrefix: A name prefix to filter results returned. Only API destinations with a name that starts with the prefix are returned.
    ///   - nextToken: The token returned by a previous call to retrieve the next set of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listApiDestinations(
        connectionArn: String? = nil,
        limit: Int? = nil,
        namePrefix: String? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListApiDestinationsResponse {
        let input = ListApiDestinationsRequest(
            connectionArn: connectionArn, 
            limit: limit, 
            namePrefix: namePrefix, 
            nextToken: nextToken
        )
        return try await self.listApiDestinations(input, logger: logger)
    }

    /// Lists your archives. You can either list all the archives or you can provide a prefix to match to the archive names. Filter parameters are exclusive.
    @Sendable
    @inlinable
    public func listArchives(_ input: ListArchivesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListArchivesResponse {
        try await self.client.execute(
            operation: "ListArchives", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists your archives. You can either list all the archives or you can provide a prefix to match to the archive names. Filter parameters are exclusive.
    ///
    /// Parameters:
    ///   - eventSourceArn: The ARN of the event source associated with the archive.
    ///   - limit: The maximum number of results to return.
    ///   - namePrefix: A name prefix to filter the archives returned. Only archives with name that match the prefix are returned.
    ///   - nextToken: The token returned by a previous call to retrieve the next set of results.
    ///   - state: The state of the archive.
    ///   - logger: Logger use during operation
    @inlinable
    public func listArchives(
        eventSourceArn: String? = nil,
        limit: Int? = nil,
        namePrefix: String? = nil,
        nextToken: String? = nil,
        state: ArchiveState? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListArchivesResponse {
        let input = ListArchivesRequest(
            eventSourceArn: eventSourceArn, 
            limit: limit, 
            namePrefix: namePrefix, 
            nextToken: nextToken, 
            state: state
        )
        return try await self.listArchives(input, logger: logger)
    }

    /// Retrieves a list of connections from the account.
    @Sendable
    @inlinable
    public func listConnections(_ input: ListConnectionsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListConnectionsResponse {
        try await self.client.execute(
            operation: "ListConnections", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves a list of connections from the account.
    ///
    /// Parameters:
    ///   - connectionState: The state of the connection.
    ///   - limit: The maximum number of connections to return.
    ///   - namePrefix: A name prefix to filter results returned. Only connections with a name that starts with the prefix are returned.
    ///   - nextToken: The token returned by a previous call to retrieve the next set of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listConnections(
        connectionState: ConnectionState? = nil,
        limit: Int? = nil,
        namePrefix: String? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListConnectionsResponse {
        let input = ListConnectionsRequest(
            connectionState: connectionState, 
            limit: limit, 
            namePrefix: namePrefix, 
            nextToken: nextToken
        )
        return try await self.listConnections(input, logger: logger)
    }

    /// Lists all the event buses in your account, including the default event bus, custom event buses, and partner event buses.
    @Sendable
    @inlinable
    public func listEventBuses(_ input: ListEventBusesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListEventBusesResponse {
        try await self.client.execute(
            operation: "ListEventBuses", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists all the event buses in your account, including the default event bus, custom event buses, and partner event buses.
    ///
    /// Parameters:
    ///   - limit: Specifying this limits the number of results returned by this operation. The operation also returns a NextToken which you can use in a subsequent operation to retrieve the next set of results.
    ///   - namePrefix: Specifying this limits the results to only those event buses with names that start with the specified prefix.
    ///   - nextToken: The token returned by a previous call to retrieve the next set of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listEventBuses(
        limit: Int? = nil,
        namePrefix: String? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListEventBusesResponse {
        let input = ListEventBusesRequest(
            limit: limit, 
            namePrefix: namePrefix, 
            nextToken: nextToken
        )
        return try await self.listEventBuses(input, logger: logger)
    }

    /// You can use this to see all the partner event sources that have been shared with your Amazon Web Services account. For more information about partner event sources, see CreateEventBus.
    @Sendable
    @inlinable
    public func listEventSources(_ input: ListEventSourcesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListEventSourcesResponse {
        try await self.client.execute(
            operation: "ListEventSources", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// You can use this to see all the partner event sources that have been shared with your Amazon Web Services account. For more information about partner event sources, see CreateEventBus.
    ///
    /// Parameters:
    ///   - limit: Specifying this limits the number of results returned by this operation. The operation also returns a NextToken which you can use in a subsequent operation to retrieve the next set of results.
    ///   - namePrefix: Specifying this limits the results to only those partner event sources with names that start with the specified prefix.
    ///   - nextToken: The token returned by a previous call to retrieve the next set of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listEventSources(
        limit: Int? = nil,
        namePrefix: String? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListEventSourcesResponse {
        let input = ListEventSourcesRequest(
            limit: limit, 
            namePrefix: namePrefix, 
            nextToken: nextToken
        )
        return try await self.listEventSources(input, logger: logger)
    }

    /// An SaaS partner can use this operation to display the Amazon Web Services account ID that a particular partner event source name is associated with. This operation is not used by Amazon Web Services customers.
    @Sendable
    @inlinable
    public func listPartnerEventSourceAccounts(_ input: ListPartnerEventSourceAccountsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListPartnerEventSourceAccountsResponse {
        try await self.client.execute(
            operation: "ListPartnerEventSourceAccounts", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// An SaaS partner can use this operation to display the Amazon Web Services account ID that a particular partner event source name is associated with. This operation is not used by Amazon Web Services customers.
    ///
    /// Parameters:
    ///   - eventSourceName: The name of the partner event source to display account information about.
    ///   - limit: Specifying this limits the number of results returned by this operation. The operation also returns a NextToken which you can use in a subsequent operation to retrieve the next set of results.
    ///   - nextToken: The token returned by a previous call to this operation. Specifying this retrieves the next set of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listPartnerEventSourceAccounts(
        eventSourceName: String,
        limit: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListPartnerEventSourceAccountsResponse {
        let input = ListPartnerEventSourceAccountsRequest(
            eventSourceName: eventSourceName, 
            limit: limit, 
            nextToken: nextToken
        )
        return try await self.listPartnerEventSourceAccounts(input, logger: logger)
    }

    /// An SaaS partner can use this operation to list all the partner event source names that they have created. This operation is not used by Amazon Web Services customers.
    @Sendable
    @inlinable
    public func listPartnerEventSources(_ input: ListPartnerEventSourcesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListPartnerEventSourcesResponse {
        try await self.client.execute(
            operation: "ListPartnerEventSources", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// An SaaS partner can use this operation to list all the partner event source names that they have created. This operation is not used by Amazon Web Services customers.
    ///
    /// Parameters:
    ///   - limit: pecifying this limits the number of results returned by this operation. The operation also returns a NextToken which you can use in a subsequent operation to retrieve the next set of results.
    ///   - namePrefix: If you specify this, the results are limited to only those partner event sources that start with the string you specify.
    ///   - nextToken: The token returned by a previous call to this operation. Specifying this retrieves the next set of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listPartnerEventSources(
        limit: Int? = nil,
        namePrefix: String,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListPartnerEventSourcesResponse {
        let input = ListPartnerEventSourcesRequest(
            limit: limit, 
            namePrefix: namePrefix, 
            nextToken: nextToken
        )
        return try await self.listPartnerEventSources(input, logger: logger)
    }

    /// Lists your replays. You can either list all the replays or you can provide a prefix to match to the replay names. Filter parameters are exclusive.
    @Sendable
    @inlinable
    public func listReplays(_ input: ListReplaysRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListReplaysResponse {
        try await self.client.execute(
            operation: "ListReplays", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists your replays. You can either list all the replays or you can provide a prefix to match to the replay names. Filter parameters are exclusive.
    ///
    /// Parameters:
    ///   - eventSourceArn: The ARN of the archive from which the events are replayed.
    ///   - limit: The maximum number of replays to retrieve.
    ///   - namePrefix: A name prefix to filter the replays returned. Only replays with name that match the prefix are returned.
    ///   - nextToken: The token returned by a previous call to retrieve the next set of results.
    ///   - state: The state of the replay.
    ///   - logger: Logger use during operation
    @inlinable
    public func listReplays(
        eventSourceArn: String? = nil,
        limit: Int? = nil,
        namePrefix: String? = nil,
        nextToken: String? = nil,
        state: ReplayState? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListReplaysResponse {
        let input = ListReplaysRequest(
            eventSourceArn: eventSourceArn, 
            limit: limit, 
            namePrefix: namePrefix, 
            nextToken: nextToken, 
            state: state
        )
        return try await self.listReplays(input, logger: logger)
    }

    /// Lists the rules for the specified target. You can see which of the rules in Amazon EventBridge can invoke a specific target in your account.
    @Sendable
    @inlinable
    public func listRuleNamesByTarget(_ input: ListRuleNamesByTargetRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListRuleNamesByTargetResponse {
        try await self.client.execute(
            operation: "ListRuleNamesByTarget", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the rules for the specified target. You can see which of the rules in Amazon EventBridge can invoke a specific target in your account.
    ///
    /// Parameters:
    ///   - eventBusName: The name or ARN of the event bus to list rules for. If you omit this, the default event bus is used.
    ///   - limit: The maximum number of results to return.
    ///   - nextToken: The token returned by a previous call to retrieve the next set of results.
    ///   - targetArn: The Amazon Resource Name (ARN) of the target resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func listRuleNamesByTarget(
        eventBusName: String? = nil,
        limit: Int? = nil,
        nextToken: String? = nil,
        targetArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListRuleNamesByTargetResponse {
        let input = ListRuleNamesByTargetRequest(
            eventBusName: eventBusName, 
            limit: limit, 
            nextToken: nextToken, 
            targetArn: targetArn
        )
        return try await self.listRuleNamesByTarget(input, logger: logger)
    }

    /// Lists your Amazon EventBridge rules. You can either list all the rules or you can provide a prefix to match to the rule names. ListRules does not list the targets of a rule. To see the targets associated with a rule, use ListTargetsByRule.
    @Sendable
    @inlinable
    public func listRules(_ input: ListRulesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListRulesResponse {
        try await self.client.execute(
            operation: "ListRules", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists your Amazon EventBridge rules. You can either list all the rules or you can provide a prefix to match to the rule names. ListRules does not list the targets of a rule. To see the targets associated with a rule, use ListTargetsByRule.
    ///
    /// Parameters:
    ///   - eventBusName: The name or ARN of the event bus to list the rules for. If you omit this, the default event bus is used.
    ///   - limit: The maximum number of results to return.
    ///   - namePrefix: The prefix matching the rule name.
    ///   - nextToken: The token returned by a previous call to retrieve the next set of results.
    ///   - logger: Logger use during operation
    @inlinable
    public func listRules(
        eventBusName: String? = nil,
        limit: Int? = nil,
        namePrefix: String? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListRulesResponse {
        let input = ListRulesRequest(
            eventBusName: eventBusName, 
            limit: limit, 
            namePrefix: namePrefix, 
            nextToken: nextToken
        )
        return try await self.listRules(input, logger: logger)
    }

    /// Displays the tags associated with an EventBridge resource. In EventBridge, rules and event buses can be tagged.
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceResponse {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Displays the tags associated with an EventBridge resource. In EventBridge, rules and event buses can be tagged.
    ///
    /// Parameters:
    ///   - resourceARN: The ARN of the EventBridge resource for which you want to view tags.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceARN: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceResponse {
        let input = ListTagsForResourceRequest(
            resourceARN: resourceARN
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    /// Lists the targets assigned to the specified rule.
    @Sendable
    @inlinable
    public func listTargetsByRule(_ input: ListTargetsByRuleRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTargetsByRuleResponse {
        try await self.client.execute(
            operation: "ListTargetsByRule", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the targets assigned to the specified rule.
    ///
    /// Parameters:
    ///   - eventBusName: The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.
    ///   - limit: The maximum number of results to return.
    ///   - nextToken: The token returned by a previous call to retrieve the next set of results.
    ///   - rule: The name of the rule.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTargetsByRule(
        eventBusName: String? = nil,
        limit: Int? = nil,
        nextToken: String? = nil,
        rule: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTargetsByRuleResponse {
        let input = ListTargetsByRuleRequest(
            eventBusName: eventBusName, 
            limit: limit, 
            nextToken: nextToken, 
            rule: rule
        )
        return try await self.listTargetsByRule(input, logger: logger)
    }

    /// Sends custom events to Amazon EventBridge so that they can be matched to rules.
    @Sendable
    @inlinable
    public func putEvents(_ input: PutEventsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> PutEventsResponse {
        try await self.client.execute(
            operation: "PutEvents", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Sends custom events to Amazon EventBridge so that they can be matched to rules.
    ///
    /// Parameters:
    ///   - entries: The entry that defines an event in your system. You can specify several parameters for the entry such as the source and type of the event, resources associated with the event, and so on.
    ///   - logger: Logger use during operation
    @inlinable
    public func putEvents(
        entries: [PutEventsRequestEntry],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> PutEventsResponse {
        let input = PutEventsRequest(
            entries: entries
        )
        return try await self.putEvents(input, logger: logger)
    }

    /// This is used by SaaS partners to write events to a customer's partner event bus. Amazon Web Services customers do not use this operation.
    @Sendable
    @inlinable
    public func putPartnerEvents(_ input: PutPartnerEventsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> PutPartnerEventsResponse {
        try await self.client.execute(
            operation: "PutPartnerEvents", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// This is used by SaaS partners to write events to a customer's partner event bus. Amazon Web Services customers do not use this operation.
    ///
    /// Parameters:
    ///   - entries: The list of events to write to the event bus.
    ///   - logger: Logger use during operation
    @inlinable
    public func putPartnerEvents(
        entries: [PutPartnerEventsRequestEntry],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> PutPartnerEventsResponse {
        let input = PutPartnerEventsRequest(
            entries: entries
        )
        return try await self.putPartnerEvents(input, logger: logger)
    }

    /// Running PutPermission permits the specified Amazon Web Services account or Amazon Web Services organization to put events to the specified event bus. Amazon EventBridge (CloudWatch Events) rules in your account are triggered by these events arriving to an event bus in your account.  For another account to send events to your account, that external account must have an EventBridge rule with your account's event bus as a target. To enable multiple Amazon Web Services accounts to put events to your event bus, run PutPermission once for each of these accounts. Or, if all the accounts are members of the same Amazon Web Services organization, you can run PutPermission once specifying Principal as "*" and specifying the Amazon Web Services organization ID in Condition, to grant permissions to all accounts in that organization. If you grant permissions using an organization, then accounts in that organization must specify a RoleArn with proper permissions when they use PutTarget to add your account's event bus as a target. For more information, see Sending and Receiving Events Between Amazon Web Services Accounts in the Amazon EventBridge User Guide. The permission policy on the event bus cannot exceed 10 KB in size.
    @Sendable
    @inlinable
    public func putPermission(_ input: PutPermissionRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "PutPermission", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Running PutPermission permits the specified Amazon Web Services account or Amazon Web Services organization to put events to the specified event bus. Amazon EventBridge (CloudWatch Events) rules in your account are triggered by these events arriving to an event bus in your account.  For another account to send events to your account, that external account must have an EventBridge rule with your account's event bus as a target. To enable multiple Amazon Web Services accounts to put events to your event bus, run PutPermission once for each of these accounts. Or, if all the accounts are members of the same Amazon Web Services organization, you can run PutPermission once specifying Principal as "*" and specifying the Amazon Web Services organization ID in Condition, to grant permissions to all accounts in that organization. If you grant permissions using an organization, then accounts in that organization must specify a RoleArn with proper permissions when they use PutTarget to add your account's event bus as a target. For more information, see Sending and Receiving Events Between Amazon Web Services Accounts in the Amazon EventBridge User Guide. The permission policy on the event bus cannot exceed 10 KB in size.
    ///
    /// Parameters:
    ///   - action: The action that you are enabling the other account to perform.
    ///   - condition: This parameter enables you to limit the permission to accounts that fulfill a certain condition, such as being a member of a certain Amazon Web Services organization. For more information about Amazon Web Services Organizations, see What Is Amazon Web Services  Organizations in the Amazon Web Services Organizations User Guide. If you specify Condition with an Amazon Web Services organization ID, and specify "*" as the value for Principal, you grant permission to all the accounts in the named organization. The Condition is a JSON string which must contain Type, Key, and Value fields.
    ///   - eventBusName: The name of the event bus associated with the rule. If you omit this, the default event bus is used.
    ///   - policy: A JSON string that describes the permission policy statement. You can include a Policy parameter in the request instead of using the StatementId, Action, Principal, or Condition parameters.
    ///   - principal: The 12-digit Amazon Web Services account ID that you are permitting to put events to your default event bus. Specify "*" to permit any account to put events to your default event bus. If you specify "*" without specifying Condition, avoid creating rules that may match undesirable events. To create more secure rules, make sure that the event pattern for each rule contains an account field with a specific account ID from which to receive events. Rules with an account field do not match any events sent from other accounts.
    ///   - statementId: An identifier string for the external account that you are granting permissions to. If you later want to revoke the permission for this external account, specify this StatementId when you run RemovePermission.
    ///   - logger: Logger use during operation
    @inlinable
    public func putPermission(
        action: String? = nil,
        condition: Condition? = nil,
        eventBusName: String? = nil,
        policy: String? = nil,
        principal: String? = nil,
        statementId: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = PutPermissionRequest(
            action: action, 
            condition: condition, 
            eventBusName: eventBusName, 
            policy: policy, 
            principal: principal, 
            statementId: statementId
        )
        return try await self.putPermission(input, logger: logger)
    }

    /// Creates or updates the specified rule. Rules are enabled by default, or based on value of the state. You can disable a rule using DisableRule. A single rule watches for events from a single event bus. Events generated by Amazon Web Services services go to your account's default event bus. Events generated by SaaS partner services or applications go to the matching partner event bus. If you have custom applications or services, you can specify whether their events go to your default event bus or a custom event bus that you have created. For more information, see CreateEventBus. If you are updating an existing rule, the rule is replaced with what you specify in this PutRule command. If you omit arguments in PutRule, the old values for those arguments are not kept. Instead, they are replaced with null values. When you create or update a rule, incoming events might not immediately start matching to new or updated rules. Allow a short period of time for changes to take effect. A rule must contain at least an EventPattern or ScheduleExpression. Rules with EventPatterns are triggered when a matching event is observed. Rules with ScheduleExpressions self-trigger based on the given schedule. A rule can have both an EventPattern and a ScheduleExpression, in which case the rule triggers on matching events as well as on a schedule. When you initially create a rule, you can optionally assign one or more tags to the rule. Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only rules with certain tag values. To use the PutRule operation and assign tags, you must have both the events:PutRule and events:TagResource permissions. If you are updating an existing rule, any tags you specify in the PutRule operation are ignored. To update the tags of an existing rule, use TagResource and UntagResource. Most services in Amazon Web Services treat : or / as the same character in Amazon Resource Names (ARNs). However, EventBridge uses an exact match in event patterns and rules. Be sure to use the correct ARN characters when creating event patterns so that they match the ARN syntax in the event you want to match. In EventBridge, it is possible to create rules that lead to infinite loops, where a rule is fired repeatedly. For example, a rule might detect that ACLs have changed on an S3 bucket, and trigger software to change them to the desired state. If the rule is not written carefully, the subsequent change to the ACLs fires the rule again, creating an infinite loop. To prevent this, write the rules so that the triggered actions do not re-fire the same rule. For example, your rule could fire only if ACLs are found to be in a bad state, instead of after any change.  An infinite loop can quickly cause higher than expected charges. We recommend that you use budgeting, which alerts you when charges exceed your specified limit. For more information, see Managing Your Costs with Budgets.
    @Sendable
    @inlinable
    public func putRule(_ input: PutRuleRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> PutRuleResponse {
        try await self.client.execute(
            operation: "PutRule", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates or updates the specified rule. Rules are enabled by default, or based on value of the state. You can disable a rule using DisableRule. A single rule watches for events from a single event bus. Events generated by Amazon Web Services services go to your account's default event bus. Events generated by SaaS partner services or applications go to the matching partner event bus. If you have custom applications or services, you can specify whether their events go to your default event bus or a custom event bus that you have created. For more information, see CreateEventBus. If you are updating an existing rule, the rule is replaced with what you specify in this PutRule command. If you omit arguments in PutRule, the old values for those arguments are not kept. Instead, they are replaced with null values. When you create or update a rule, incoming events might not immediately start matching to new or updated rules. Allow a short period of time for changes to take effect. A rule must contain at least an EventPattern or ScheduleExpression. Rules with EventPatterns are triggered when a matching event is observed. Rules with ScheduleExpressions self-trigger based on the given schedule. A rule can have both an EventPattern and a ScheduleExpression, in which case the rule triggers on matching events as well as on a schedule. When you initially create a rule, you can optionally assign one or more tags to the rule. Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by granting a user permission to access or change only rules with certain tag values. To use the PutRule operation and assign tags, you must have both the events:PutRule and events:TagResource permissions. If you are updating an existing rule, any tags you specify in the PutRule operation are ignored. To update the tags of an existing rule, use TagResource and UntagResource. Most services in Amazon Web Services treat : or / as the same character in Amazon Resource Names (ARNs). However, EventBridge uses an exact match in event patterns and rules. Be sure to use the correct ARN characters when creating event patterns so that they match the ARN syntax in the event you want to match. In EventBridge, it is possible to create rules that lead to infinite loops, where a rule is fired repeatedly. For example, a rule might detect that ACLs have changed on an S3 bucket, and trigger software to change them to the desired state. If the rule is not written carefully, the subsequent change to the ACLs fires the rule again, creating an infinite loop. To prevent this, write the rules so that the triggered actions do not re-fire the same rule. For example, your rule could fire only if ACLs are found to be in a bad state, instead of after any change.  An infinite loop can quickly cause higher than expected charges. We recommend that you use budgeting, which alerts you when charges exceed your specified limit. For more information, see Managing Your Costs with Budgets.
    ///
    /// Parameters:
    ///   - description: A description of the rule.
    ///   - eventBusName: The name or ARN of the event bus to associate with this rule. If you omit this, the default event bus is used.
    ///   - eventPattern: The event pattern. For more information, see Events and Event Patterns in the Amazon EventBridge User Guide.
    ///   - name: The name of the rule that you are creating or updating.
    ///   - roleArn: The Amazon Resource Name (ARN) of the IAM role associated with the rule. If you're setting an event bus in another account as the target and that account granted permission to your account through an organization instead of directly by the account ID, you must specify a RoleArn with proper permissions in the Target structure, instead of here in this parameter.
    ///   - scheduleExpression: The scheduling expression. For example, "cron(0 20 * * ? *)" or "rate(5 minutes)".
    ///   - state: Indicates whether the rule is enabled or disabled.
    ///   - tags: The list of key-value pairs to associate with the rule.
    ///   - logger: Logger use during operation
    @inlinable
    public func putRule(
        description: String? = nil,
        eventBusName: String? = nil,
        eventPattern: String? = nil,
        name: String,
        roleArn: String? = nil,
        scheduleExpression: String? = nil,
        state: RuleState? = nil,
        tags: [Tag]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> PutRuleResponse {
        let input = PutRuleRequest(
            description: description, 
            eventBusName: eventBusName, 
            eventPattern: eventPattern, 
            name: name, 
            roleArn: roleArn, 
            scheduleExpression: scheduleExpression, 
            state: state, 
            tags: tags
        )
        return try await self.putRule(input, logger: logger)
    }

    /// Adds the specified targets to the specified rule, or updates the targets if they are already associated with the rule. Targets are the resources that are invoked when a rule is triggered. You can configure the following as targets for Events:    API destination    Amazon API Gateway REST API endpoints   API Gateway   Batch job queue   CloudWatch Logs group   CodeBuild project   CodePipeline   Amazon EC2 CreateSnapshot API call   Amazon EC2 RebootInstances API call   Amazon EC2 StopInstances API call   Amazon EC2 TerminateInstances API call   Amazon ECS tasks   Event bus in a different Amazon Web Services account or Region. You can use an event bus in the US East (N. Virginia) us-east-1, US West (Oregon) us-west-2, or Europe (Ireland) eu-west-1 Regions as a target for a rule.   Firehose delivery stream (Firehose)   Inspector assessment template (Amazon Inspector)   Kinesis stream (Kinesis Data Stream)   Lambda function   Redshift clusters (Data API statement execution)   Amazon SNS topic   Amazon SQS queues (includes FIFO queues   SSM Automation   SSM OpsItem   SSM Run Command   Step Functions state machines   Creating rules with built-in targets is supported only in the Amazon Web Services Management Console. The built-in targets are EC2 CreateSnapshot API call, EC2 RebootInstances API call, EC2 StopInstances API call, and EC2 TerminateInstances API call.  For some target types, PutTargets provides target-specific parameters. If the target is a Kinesis data stream, you can optionally specify which shard the event goes to by using the KinesisParameters argument. To invoke a command on multiple EC2 instances with one rule, you can use the RunCommandParameters field. To be able to make API calls against the resources that you own, Amazon EventBridge needs the appropriate permissions. For Lambda and Amazon SNS resources, EventBridge relies on resource-based policies. For EC2 instances, Kinesis Data Streams,  Step Functions state machines and API Gateway REST APIs, EventBridge relies on IAM roles that you specify in the RoleARN argument in PutTargets. For more information, see Authentication and Access Control in the Amazon EventBridge User Guide. If another Amazon Web Services account is in the same region and has granted you permission (using PutPermission), you can send events to that account. Set that account's event bus as a target of the rules in your account. To send the matched events to the other account, specify that account's event bus as the Arn value when you run PutTargets. If your account sends events to another account, your account is charged for each sent event. Each event sent to another account is charged as a custom event. The account receiving the event is not charged. For more information, see Amazon EventBridge Pricing.   Input, InputPath, and InputTransformer are not available with PutTarget if the target is an event bus of a different Amazon Web Services  account.  If you are setting the event bus of another account as the target, and that account granted permission to your account through an organization instead of directly by the account ID, then you must specify a RoleArn with proper permissions in the Target structure. For more information, see Sending and Receiving Events Between Amazon Web Services Accounts in the Amazon EventBridge User Guide. For more information about enabling cross-account events, see PutPermission.  Input, InputPath, and InputTransformer are mutually exclusive and optional parameters of a target. When a rule is triggered due to a matched event:   If none of the following arguments are specified for a target, then the entire event is passed to the target in JSON format (unless the target is Amazon EC2 Run Command or Amazon ECS task, in which case nothing from the event is passed to the target).   If Input is specified in the form of valid JSON, then the matched event is overridden with this constant.   If InputPath is specified in the form of JSONPath (for example, $.detail), then only the part of the event specified in the path is passed to the target (for example, only the detail part of the event is passed).   If InputTransformer is specified, then one or more specified JSONPaths are extracted from the event and used as values in a template that you specify as the input to the target.   When you specify InputPath or InputTransformer, you must use JSON dot notation, not bracket notation. When you add targets to a rule and the associated rule triggers soon after, new or updated targets might not be immediately invoked. Allow a short period of time for changes to take effect. This action can partially fail if too many requests are made at the same time. If that happens, FailedEntryCount is non-zero in the response and each entry in FailedEntries provides the ID of the failed target and the error code.
    @Sendable
    @inlinable
    public func putTargets(_ input: PutTargetsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> PutTargetsResponse {
        try await self.client.execute(
            operation: "PutTargets", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Adds the specified targets to the specified rule, or updates the targets if they are already associated with the rule. Targets are the resources that are invoked when a rule is triggered. You can configure the following as targets for Events:    API destination    Amazon API Gateway REST API endpoints   API Gateway   Batch job queue   CloudWatch Logs group   CodeBuild project   CodePipeline   Amazon EC2 CreateSnapshot API call   Amazon EC2 RebootInstances API call   Amazon EC2 StopInstances API call   Amazon EC2 TerminateInstances API call   Amazon ECS tasks   Event bus in a different Amazon Web Services account or Region. You can use an event bus in the US East (N. Virginia) us-east-1, US West (Oregon) us-west-2, or Europe (Ireland) eu-west-1 Regions as a target for a rule.   Firehose delivery stream (Firehose)   Inspector assessment template (Amazon Inspector)   Kinesis stream (Kinesis Data Stream)   Lambda function   Redshift clusters (Data API statement execution)   Amazon SNS topic   Amazon SQS queues (includes FIFO queues   SSM Automation   SSM OpsItem   SSM Run Command   Step Functions state machines   Creating rules with built-in targets is supported only in the Amazon Web Services Management Console. The built-in targets are EC2 CreateSnapshot API call, EC2 RebootInstances API call, EC2 StopInstances API call, and EC2 TerminateInstances API call.  For some target types, PutTargets provides target-specific parameters. If the target is a Kinesis data stream, you can optionally specify which shard the event goes to by using the KinesisParameters argument. To invoke a command on multiple EC2 instances with one rule, you can use the RunCommandParameters field. To be able to make API calls against the resources that you own, Amazon EventBridge needs the appropriate permissions. For Lambda and Amazon SNS resources, EventBridge relies on resource-based policies. For EC2 instances, Kinesis Data Streams,  Step Functions state machines and API Gateway REST APIs, EventBridge relies on IAM roles that you specify in the RoleARN argument in PutTargets. For more information, see Authentication and Access Control in the Amazon EventBridge User Guide. If another Amazon Web Services account is in the same region and has granted you permission (using PutPermission), you can send events to that account. Set that account's event bus as a target of the rules in your account. To send the matched events to the other account, specify that account's event bus as the Arn value when you run PutTargets. If your account sends events to another account, your account is charged for each sent event. Each event sent to another account is charged as a custom event. The account receiving the event is not charged. For more information, see Amazon EventBridge Pricing.   Input, InputPath, and InputTransformer are not available with PutTarget if the target is an event bus of a different Amazon Web Services  account.  If you are setting the event bus of another account as the target, and that account granted permission to your account through an organization instead of directly by the account ID, then you must specify a RoleArn with proper permissions in the Target structure. For more information, see Sending and Receiving Events Between Amazon Web Services Accounts in the Amazon EventBridge User Guide. For more information about enabling cross-account events, see PutPermission.  Input, InputPath, and InputTransformer are mutually exclusive and optional parameters of a target. When a rule is triggered due to a matched event:   If none of the following arguments are specified for a target, then the entire event is passed to the target in JSON format (unless the target is Amazon EC2 Run Command or Amazon ECS task, in which case nothing from the event is passed to the target).   If Input is specified in the form of valid JSON, then the matched event is overridden with this constant.   If InputPath is specified in the form of JSONPath (for example, $.detail), then only the part of the event specified in the path is passed to the target (for example, only the detail part of the event is passed).   If InputTransformer is specified, then one or more specified JSONPaths are extracted from the event and used as values in a template that you specify as the input to the target.   When you specify InputPath or InputTransformer, you must use JSON dot notation, not bracket notation. When you add targets to a rule and the associated rule triggers soon after, new or updated targets might not be immediately invoked. Allow a short period of time for changes to take effect. This action can partially fail if too many requests are made at the same time. If that happens, FailedEntryCount is non-zero in the response and each entry in FailedEntries provides the ID of the failed target and the error code.
    ///
    /// Parameters:
    ///   - eventBusName: The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.
    ///   - rule: The name of the rule.
    ///   - targets: The targets to update or add to the rule.
    ///   - logger: Logger use during operation
    @inlinable
    public func putTargets(
        eventBusName: String? = nil,
        rule: String,
        targets: [Target],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> PutTargetsResponse {
        let input = PutTargetsRequest(
            eventBusName: eventBusName, 
            rule: rule, 
            targets: targets
        )
        return try await self.putTargets(input, logger: logger)
    }

    /// Revokes the permission of another Amazon Web Services account to be able to put events to the specified event bus. Specify the account to revoke by the StatementId value that you associated with the account when you granted it permission with PutPermission. You can find the StatementId by using DescribeEventBus.
    @Sendable
    @inlinable
    public func removePermission(_ input: RemovePermissionRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "RemovePermission", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Revokes the permission of another Amazon Web Services account to be able to put events to the specified event bus. Specify the account to revoke by the StatementId value that you associated with the account when you granted it permission with PutPermission. You can find the StatementId by using DescribeEventBus.
    ///
    /// Parameters:
    ///   - eventBusName: The name of the event bus to revoke permissions for. If you omit this, the default event bus is used.
    ///   - removeAllPermissions: Specifies whether to remove all permissions.
    ///   - statementId: The statement ID corresponding to the account that is no longer allowed to put events to the default event bus.
    ///   - logger: Logger use during operation
    @inlinable
    public func removePermission(
        eventBusName: String? = nil,
        removeAllPermissions: Bool? = nil,
        statementId: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = RemovePermissionRequest(
            eventBusName: eventBusName, 
            removeAllPermissions: removeAllPermissions, 
            statementId: statementId
        )
        return try await self.removePermission(input, logger: logger)
    }

    /// Removes the specified targets from the specified rule. When the rule is triggered, those targets are no longer be invoked. When you remove a target, when the associated rule triggers, removed targets might continue to be invoked. Allow a short period of time for changes to take effect. This action can partially fail if too many requests are made at the same time. If that happens, FailedEntryCount is non-zero in the response and each entry in FailedEntries provides the ID of the failed target and the error code.
    @Sendable
    @inlinable
    public func removeTargets(_ input: RemoveTargetsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> RemoveTargetsResponse {
        try await self.client.execute(
            operation: "RemoveTargets", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes the specified targets from the specified rule. When the rule is triggered, those targets are no longer be invoked. When you remove a target, when the associated rule triggers, removed targets might continue to be invoked. Allow a short period of time for changes to take effect. This action can partially fail if too many requests are made at the same time. If that happens, FailedEntryCount is non-zero in the response and each entry in FailedEntries provides the ID of the failed target and the error code.
    ///
    /// Parameters:
    ///   - eventBusName: The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.
    ///   - force: If this is a managed rule, created by an Amazon Web Services service on your behalf, you must specify Force as True to remove targets. This parameter is ignored for rules that are not managed rules. You can check whether a rule is a managed rule by using DescribeRule or ListRules and checking the ManagedBy field of the response.
    ///   - ids: The IDs of the targets to remove from the rule.
    ///   - rule: The name of the rule.
    ///   - logger: Logger use during operation
    @inlinable
    public func removeTargets(
        eventBusName: String? = nil,
        force: Bool? = nil,
        ids: [String],
        rule: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> RemoveTargetsResponse {
        let input = RemoveTargetsRequest(
            eventBusName: eventBusName, 
            force: force, 
            ids: ids, 
            rule: rule
        )
        return try await self.removeTargets(input, logger: logger)
    }

    /// Starts the specified replay. Events are not necessarily replayed in the exact same order that they were added to the archive. A replay processes events to replay based on the time in the event, and replays them using 1 minute intervals. If you specify an EventStartTime and an EventEndTime that covers a 20 minute time range, the events are replayed from the first minute of that 20 minute range first. Then the events from the second minute are replayed. You can use DescribeReplay to determine the progress of a replay. The value returned for EventLastReplayedTime indicates the time within the specified time range associated with the last event replayed.
    @Sendable
    @inlinable
    public func startReplay(_ input: StartReplayRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> StartReplayResponse {
        try await self.client.execute(
            operation: "StartReplay", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Starts the specified replay. Events are not necessarily replayed in the exact same order that they were added to the archive. A replay processes events to replay based on the time in the event, and replays them using 1 minute intervals. If you specify an EventStartTime and an EventEndTime that covers a 20 minute time range, the events are replayed from the first minute of that 20 minute range first. Then the events from the second minute are replayed. You can use DescribeReplay to determine the progress of a replay. The value returned for EventLastReplayedTime indicates the time within the specified time range associated with the last event replayed.
    ///
    /// Parameters:
    ///   - description: A description for the replay to start.
    ///   - destination: A ReplayDestination object that includes details about the destination for the replay.
    ///   - eventEndTime: A time stamp for the time to stop replaying events. Only events that occurred between the EventStartTime and EventEndTime are replayed.
    ///   - eventSourceArn: The ARN of the archive to replay events from.
    ///   - eventStartTime: A time stamp for the time to start replaying events. Only events that occurred between the EventStartTime and EventEndTime are replayed.
    ///   - replayName: The name of the replay to start.
    ///   - logger: Logger use during operation
    @inlinable
    public func startReplay(
        description: String? = nil,
        destination: ReplayDestination,
        eventEndTime: Date,
        eventSourceArn: String,
        eventStartTime: Date,
        replayName: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> StartReplayResponse {
        let input = StartReplayRequest(
            description: description, 
            destination: destination, 
            eventEndTime: eventEndTime, 
            eventSourceArn: eventSourceArn, 
            eventStartTime: eventStartTime, 
            replayName: replayName
        )
        return try await self.startReplay(input, logger: logger)
    }

    /// Assigns one or more tags (key-value pairs) to the specified EventBridge resource. Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values. In EventBridge, rules and event buses can be tagged. Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters. You can use the TagResource action with a resource that already has tags. If you specify a new tag key, this tag is appended to the list of tags associated with the resource. If you specify a tag key that is already associated with the resource, the new tag value that you specify replaces the previous value for that tag. You can associate as many as 50 tags with a resource.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceResponse {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Assigns one or more tags (key-value pairs) to the specified EventBridge resource. Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values. In EventBridge, rules and event buses can be tagged. Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters. You can use the TagResource action with a resource that already has tags. If you specify a new tag key, this tag is appended to the list of tags associated with the resource. If you specify a tag key that is already associated with the resource, the new tag value that you specify replaces the previous value for that tag. You can associate as many as 50 tags with a resource.
    ///
    /// Parameters:
    ///   - resourceARN: The ARN of the EventBridge resource that you're adding tags to.
    ///   - tags: The list of key-value pairs to associate with the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceARN: String,
        tags: [Tag],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceResponse {
        let input = TagResourceRequest(
            resourceARN: resourceARN, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Tests whether the specified event pattern matches the provided event. Most services in Amazon Web Services treat : or / as the same character in Amazon Resource Names (ARNs). However, EventBridge uses an exact match in event patterns and rules. Be sure to use the correct ARN characters when creating event patterns so that they match the ARN syntax in the event you want to match.
    @Sendable
    @inlinable
    public func testEventPattern(_ input: TestEventPatternRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> TestEventPatternResponse {
        try await self.client.execute(
            operation: "TestEventPattern", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Tests whether the specified event pattern matches the provided event. Most services in Amazon Web Services treat : or / as the same character in Amazon Resource Names (ARNs). However, EventBridge uses an exact match in event patterns and rules. Be sure to use the correct ARN characters when creating event patterns so that they match the ARN syntax in the event you want to match.
    ///
    /// Parameters:
    ///   - event: The event, in JSON format, to test against the event pattern. The JSON must follow the format specified in Amazon Web Services Events, and the following fields are mandatory:    id     account     source     time     region     resources     detail-type
    ///   - eventPattern: The event pattern. For more information, see Events and Event Patterns in the Amazon EventBridge User Guide.
    ///   - logger: Logger use during operation
    @inlinable
    public func testEventPattern(
        event: String,
        eventPattern: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TestEventPatternResponse {
        let input = TestEventPatternRequest(
            event: event, 
            eventPattern: eventPattern
        )
        return try await self.testEventPattern(input, logger: logger)
    }

    /// Removes one or more tags from the specified EventBridge resource. In Amazon EventBridge (CloudWatch Events), rules and event buses can be tagged.
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceResponse {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes one or more tags from the specified EventBridge resource. In Amazon EventBridge (CloudWatch Events), rules and event buses can be tagged.
    ///
    /// Parameters:
    ///   - resourceARN: The ARN of the EventBridge resource from which you are removing tags.
    ///   - tagKeys: The list of tag keys to remove from the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceARN: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceResponse {
        let input = UntagResourceRequest(
            resourceARN: resourceARN, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Updates an API destination.
    @Sendable
    @inlinable
    public func updateApiDestination(_ input: UpdateApiDestinationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateApiDestinationResponse {
        try await self.client.execute(
            operation: "UpdateApiDestination", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates an API destination.
    ///
    /// Parameters:
    ///   - connectionArn: The ARN of the connection to use for the API destination.
    ///   - description: The name of the API destination to update.
    ///   - httpMethod: The method to use for the API destination.
    ///   - invocationEndpoint: The URL to the endpoint to use for the API destination.
    ///   - invocationRateLimitPerSecond: The maximum number of invocations per second to send to the API destination.
    ///   - name: The name of the API destination to update.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateApiDestination(
        connectionArn: String? = nil,
        description: String? = nil,
        httpMethod: ApiDestinationHttpMethod? = nil,
        invocationEndpoint: String? = nil,
        invocationRateLimitPerSecond: Int? = nil,
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateApiDestinationResponse {
        let input = UpdateApiDestinationRequest(
            connectionArn: connectionArn, 
            description: description, 
            httpMethod: httpMethod, 
            invocationEndpoint: invocationEndpoint, 
            invocationRateLimitPerSecond: invocationRateLimitPerSecond, 
            name: name
        )
        return try await self.updateApiDestination(input, logger: logger)
    }

    /// Updates the specified archive.
    @Sendable
    @inlinable
    public func updateArchive(_ input: UpdateArchiveRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateArchiveResponse {
        try await self.client.execute(
            operation: "UpdateArchive", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates the specified archive.
    ///
    /// Parameters:
    ///   - archiveName: The name of the archive to update.
    ///   - description: The description for the archive.
    ///   - eventPattern: The event pattern to use to filter events sent to the archive.
    ///   - retentionDays: The number of days to retain events in the archive.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateArchive(
        archiveName: String,
        description: String? = nil,
        eventPattern: String? = nil,
        retentionDays: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateArchiveResponse {
        let input = UpdateArchiveRequest(
            archiveName: archiveName, 
            description: description, 
            eventPattern: eventPattern, 
            retentionDays: retentionDays
        )
        return try await self.updateArchive(input, logger: logger)
    }

    /// Updates settings for a connection.
    @Sendable
    @inlinable
    public func updateConnection(_ input: UpdateConnectionRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateConnectionResponse {
        try await self.client.execute(
            operation: "UpdateConnection", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates settings for a connection.
    ///
    /// Parameters:
    ///   - authorizationType: The type of authorization to use for the connection.
    ///   - authParameters: The authorization parameters to use for the connection.
    ///   - description: A description for the connection.
    ///   - name: The name of the connection to update.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateConnection(
        authorizationType: ConnectionAuthorizationType? = nil,
        authParameters: UpdateConnectionAuthRequestParameters? = nil,
        description: String? = nil,
        name: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateConnectionResponse {
        let input = UpdateConnectionRequest(
            authorizationType: authorizationType, 
            authParameters: authParameters, 
            description: description, 
            name: name
        )
        return try await self.updateConnection(input, logger: logger)
    }
}

extension CloudWatchEvents {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: CloudWatchEvents, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}
